<?php


namespace app\admin\validate;

use think\Validate;

class Category extends Validate
{
    protected $rule = [
        'name' => 'require',
        'pid' => 'require',
        'id' => 'require',
        'listorder' => 'require|number',
        'status' => 'require|number'
    ];

    protected $message = [
        'name' => '分类名称必须',
        'pid' => '父类id必须',
        'id' => 'id必须',
        'listorder.require' => '排序必须',
        'listorder.number' => '排序必须是数字',
        'status.require' => '验证必须',
        'status.number' => '验证必须是数字',


    ];
    protected $scene = [
        'save' => ['name', 'pid'],
        'listorder' => ['id', 'listorder'],
        'status' => ['status', 'id'],
        'update'=>['id','name'],
    ];


}